import { createApp, onMounted, watch } from 'vue'
import { createPinia } from 'pinia'
import 'element-plus/dist/index.css'
import App from './App.vue'
import router from './router'
import LoginView from './views/LoginView.vue'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import ElementPlus from 'element-plus'
import zhCn from 'element-plus/es/locale/lang/zh-cn'

// const app = createApp(LoginView)
const app = createApp(App)

app.use(createPinia())
app.use(router)
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}
app.use(ElementPlus, {
  locale: zhCn,
})


app.directive("checkButton", {
  mounted(el: any, { value }) {
    if (!(localStorage.getItem("buttonListStr")||'').includes(value)) {
      el.style.display = "none"
    } else {
      el.style.display = ''
    }
  }
})



app.mount('#app')
